<div class="widget-head" style="margin-top:0;">
    <div class="widget-title">缓存设置</div>
</div>
<style>
    .img-ctl {
        width: 100%;
        height: 153px;
    }

    .img-ctl img {
        width: 100%;
        height: 153px;
    }

    .title-ctl {
        height: 38px;
        line-height: 38px;
        margin-top: 5px;
    }

    .yjc-left {
        float: left;
        padding-left: 20px;
    }

    .yjc-right {
        float: right;
    }
</style>
<div class="layui-container" style="width:100%;">
    <div style="width: 200px;margin-left: 20px">
        <div>
            <div class="img-ctl">
                <img src="/Public/images/index_1_1.png">
            </div>
            <div class="title-ctl">
                <div class="yjc-left">首页</div>
                <div class="yjc-right"><button class="layui-btn layui-btn-danger" data-url="/admin/config/clean_home_cache">更新缓存</button></div>
            </div>
        </div>
    </div>
</div>
<script>
    layui.use('jquery', function() {
        var $ = layui.jquery;
        $('.yjc-right .layui-btn').click(function() {
            var url = $(this).attr('data-url');
            $.get(url, function(ret) {
                if (ret.status) {
                    layer.msg(ret.info, {
                        icon: 1,
                        time: 1000
                    });
                } else {
                    layer.msg(ret.info, {
                        icon: 2,
                        time: 1000
                    });
                }
            });
        });
    });
</script>